/*
 * @Author: your name
 * @Date: 2020-08-26 16:32:33
 * @LastEditTime: 2020-08-31 14:43:26
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /express/src/index.ts
 */
import express, {Request, Response} from 'express';
import bodyParser from 'body-parser';
import cookieSession from 'cookie-session';
// import router from './router';
import './controller/LoginController';
import { router } from './controller/decorator';

const app = express();

app.use(bodyParser.urlencoded({ extended: false }));
app.use(
  cookieSession({
    name: 'session',
    keys: ['teacher dell'],
    maxAge: 24 * 60 * 1000
  })
);

app.use(router)

app.listen(7001, () => {
  console.log('server is running http://localhost:7001/');
})
